/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bestco.bela.EntityClasses;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Bampa
 */
@Entity
@Table(name = "creditlevel", catalog = "bela", schema = "")

public class Creditlevel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idCredit", nullable = false)
    private Integer idCredit;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idCredit")
    private Collection<Login> loginCollection;

    public Creditlevel() {
    }

    public Creditlevel(Integer idCredit) {
        this.idCredit = idCredit;
    }

    public Integer getIdCredit() {
        return idCredit;
    }

    public void setIdCredit(Integer idCredit) {
        this.idCredit = idCredit;
    }

    public Collection<Login> getLoginCollection() {
        return loginCollection;
    }

    public void setLoginCollection(Collection<Login> loginCollection) {
        this.loginCollection = loginCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCredit != null ? idCredit.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Creditlevel)) {
            return false;
        }
        Creditlevel other = (Creditlevel) object;
        if ((this.idCredit == null && other.idCredit != null) || (this.idCredit != null && !this.idCredit.equals(other.idCredit))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bestco.lf.EntytiClasses.Creditlevel[idCredit=" + idCredit + "]";
    }

}
